package com.ysd.lis.controller.bac;


import com.ysd.common.Result;
import com.ysd.lis.controller.pub.BaseController;
import com.ysd.lis.entity.bac.BacStrain;
import com.ysd.lis.request.Params;
import com.ysd.lis.request.bac.BacBatchStrainVo;
import com.ysd.lis.service.bac.BacStrainService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author wanghuaixing
 * @since 2024-04-09
 */
@RestController
@RequestMapping("/bac/strain")
public class BacStrainController extends BaseController {

    @Autowired
    BacStrainService bacStrainService;

    @ApiOperation("获取菌株")
    @GetMapping("/findStrain")
    public Result findStrain(Params params) {
        return bacStrainService.findStrain(params);
    }

    @ApiOperation("添加菌株")
    @PostMapping("/addStrain")
    public Result addStrain(@RequestBody BacStrain bacStrain) {
        return bacStrainService.addStrain(bacStrain);
    }

    @ApiOperation("批量添加菌株")
    @PostMapping("/addBatchStrain")
    public Result addBatchStrain(@RequestBody BacBatchStrainVo bacBatchStrainVo) {
        return bacStrainService.addBatchStrain(bacBatchStrainVo);
    }


    @ApiOperation("删除菌株")
    @PostMapping("/deleteStrain")
    public Result deleteBacStrain(@RequestBody BacStrain bacStrain) {
        return bacStrainService.deleteBacStrain(bacStrain);
    }
}
